<%-- 
    Document   : closeWindowPage
    Created on : Nov 15, 2009, 10:42:57 PM
    Author     : makcro
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <script type="text/javascript">

            function strEndsWith(str, suffix) {
                return str.match(suffix+"$")==suffix;
            }

            function insertParam(key, value)
            {
                key = escape(key); value = escape(value);

                var kvp = document.location.search.substr(1).split('&');

                var i=kvp.length; var x; while(i--)
                {
                    x = kvp[i].split('=');

                    if (x[0]==key)
                    {
                        x[1] = value;
                        kvp[i] = x.join('=');
                        break;
                    }
                }

                if(i<0) {kvp[kvp.length] = [key,value].join('=');}

                //this will reload the page, it's likely better to store this until finished
               

                document.location.search = kvp.join('&');
            }



            function reloadOpener(){
                var openerUrl = opener.window.location.toString();
                
                if(!strEndsWith(openerUrl, "actions")){
                    opener.window.location = opener.window.location + '#actions';
                }
                
                opener.window.location.reload();
            }





        </script>
    </head>
    <body onload="reloadOpener();window.close();">

    </body>
</html>
